<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/pages/safeai/jsp/common/taglibs.jsp"%>
<%@ page isELIgnored ="false" %>
<html>
<head>
<title>新增功能--投票管理</title>
<link href="${ctx}/css/safeai/together.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
//window.onload=function(){

//}
function deletes(args){
 if(args=="all"){
   //获取所有要删除的id
   var voteIds=document.getElementsByName("voteid"); 
   var voteIdstr="";
   for(var i=0;i<voteIds.length;i++){
       if(voteIds[i].checked==true){
          voteIdstr+=voteIds[i].value+",";
       }
   }
   if(voteIdstr==""){
      alert("请选择要删除的投票！");
   }else{
      var hiddVoteIds=document.getElementById("voteids");
      hiddVoteIds.value=voteIdstr.substring(0,voteIdstr.length-1);
      //alert(hiddVoteIds.value);
      document.forms[0].submit();
   }
 }
}

</script>
</head>
<body>
<html:form action="/others/voteManage" method="post">
<input type="hidden" name="method" value="deletes"/>
<table width="650px"  align="center" >
	 <tr>
	        <TH class="td_01" height="25px">选中</TH>
	    	<TH class="td_01">id</TH>	    	
	    	<TH class="td_01">标题</TH>
	    	<TH class="td_01" width="18%">操作</TH>
	 </tr>
	<logic:present name="votes">
		<logic:iterate id="vote" name="votes">
			<tr>
			    <td class="td_03"><input type="checkbox" name="voteid" value="${vote.id}"></td>
				<td class="td_03">${vote.id}</td>
				<td class="td_03">${vote.title}</td>				
				<td class="td_03">
				<a href="${ctx}/others/voteManage.do?method=edit&vote.id=${vote.id}">编辑</a>
				&nbsp; &nbsp; &nbsp; &nbsp; 
                <a href="#"	onmousedown="if(confirm('是否删除？')==true) location.href='${ctx}/others/voteManage.do?method=delete&vote.id=${vote.id}'">删除</a>
                </td>
			</tr>
		</logic:iterate>
	</logic:present>
	<tr>
		<td class="td_01" colspan="4"><a href="${ctx}/others/voteManage.do?method=add">增加新内容</a>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<logic:present name="votes">
		<a href="javascript:deletes('all')">删除选中项</a></td>
		</logic:present>
	</tr>
	
</table>
<input type="hidden" name="ids" id="voteids">
</html:form>
</body>
</html>